package com.example.entities;

import java.io.Serializable;

import org.bson.types.ObjectId;

import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Field;
import dev.morphia.annotations.Id;
import dev.morphia.annotations.Index;
import dev.morphia.annotations.IndexOptions;
import dev.morphia.annotations.Indexes;
import lombok.Data;

@Entity("author")
@Indexes(
        @Index(fields = @Field("name"), options = @IndexOptions(unique = true))
)
@Data
public class Author implements Serializable {
 
    private static final long serialVersionUID = 8865924572908510997L;

	@Id
    private ObjectId id;
 
    private String name;
 
    private String sex;
 
    private int age;
 
    private String address;
 
    private String phone;
}